<?php
namespace app\index\controller;

class Test
{
   
    function test()
    {
        $before = "201706280001";
        $nowdate = getnowtime();
        $qi_name = "";
        if (!$before||$before==""){
            $qi_name = $nowdate."0001";
        }else {
            $beforedate = substr($before,0,8);
            $beforenum = substr($before,8,4);
            if ($beforedate!=$nowdate){
                $qi_name = $nowdate."0001";
            }else {
               $nownumtmp = "".(intval($beforenum)+1);
               $nownum=$nownumtmp;
               for($i=0;$i<(4-strlen($nownumtmp));$i++){
                   $nownum = "0".$nownum;
               }
               $qi_name = $nowdate.$nownum;
            }
        }
        echo $qi_name;
    }
    function test4(){
        header('Access-Control-Allow-Origin:*');
        $jc = new \app\index\model\Jccount();
        return json($jc->readjc());
    }
    function test3(){
       $types= new \app\index\model\Types();
        return json($types->getType(1));
    }

    function test2()
    {
        $jcaccount = new \app\index\model\Jccount();
        $local = $jcaccount->getLock();
     $jcaccount->kaijaing($local);
    }
    
}
